home *** CD-ROM | disk | FTP | other *** search
- /*
- File: HFSHalfGateway.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
-
- #ifndef __HFSHALFGATEWAY__
- #define __HFSHALFGATEWAY__
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __HALFGATEWAY__
- #include "HalfGateway.h"
- #endif
-
- #ifndef THREAD_H
- // #include "Thread.h"
- #endif
-
- #ifndef __OCE__
- #include "OCE.h"
- #endif
-
- class TMailGateway;
- class TLetter;
- class TRecipient;
-
- /***********************************|****************************************/
-
- class THFSHalfGateway : public THalfGateway
- {
- public:
- THFSHalfGateway();
- virtual ~THFSHalfGateway ();
-
- virtual Boolean Setup (TMailGateway& gateway, short vRefNum, long dirID, const char* gatewayName);
-
- virtual Boolean BeginRecoveryPhase();
- virtual Boolean IsRecoveryDone();
- virtual Boolean FinishRecoveryPhase();
-
- virtual Boolean ResendLetter (TLetter*);
- virtual Boolean RereceiveLetter (TLetter*);
-
- virtual Boolean Run ();
- virtual Boolean SendLetter (TLetter*);
- virtual Boolean ReceiveLetter (TLetter*);
-
- virtual Boolean PrepareToShutDown(long inHowManySeconds);
- virtual Boolean IsHalfGatewayShuttingDown();
- virtual Boolean IsHalfGatewayReadyToShutDown();
- virtual Boolean CancelHalfGatewayShutdown ();
- virtual Boolean ShutDown();
-
- void ScanHFSForOutgoingLetters();
-
- protected:
-
- Boolean ReceiveIncomingLetterForRecipient (TLetter *, TRecipient *);
-
- // This reads the 'startup' configuration from the disk, placing it into our
- // fields serverIdentity, and serverIdentityKey.
-
- OSErr CreateLetterFromFSSpec(FSSpec& fileSpec, RString& address,short isFile);
-
- Boolean fShuttingDown; // this is set to true when the gateway is trying
- RString fServerName;
- thread* fRunThreadH;
- thread* fScanHFSThreadH; // this thread periodically checks if mail is
- short fWorkingVRefNum; // the vRefNum of this half gateway.
- long fWorkingDirID;
- long fHFSMailFolderDirID;
- long fSentMailDir;
- };
-
- /***********************************|****************************************/
-
- #endif // __HFSHALFGATEWAY__
-